﻿@model B4Deal.Models.Deal
<link href="@Url.Content("~/Content/Layout/Product.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Layout/jquery.countdown.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/js/jquery.raty.js")" type="text/javascript"></script>
<div style="margin-bottom: 100px;">
    <div id="k2deals-wrapper">
        <div class="k2deals-buynow">
            <a href="javascript:void()" onclick = "Add2Cart(@Model.MaKM)" style="font-size: 30px !important; margin-left: -5px;">MUA</a>
             <span
                class="k2deals-buynow-span" style="color: #000 !important; font-size: 30px !important">
                @{
                    var a = Model.DonGiaMoi / 1000;
                }
                @a<em style="font-style: normal">k</em> </span>
        </div>
        <div class="k2deals-inner">
            <div class="k2deals-inner-value-header">
                <ul>
                    <li><span>GIÁ TRỊ</span>
                        @{a = Model.DonGiaCu / 1000;}@a<em style="font-style: normal">k</em></li>
                    <li><span>GIẢM</span>
                        @{a = (Model.DonGiaCu - Model.DonGiaMoi) * 100 / Model.DonGiaCu;}@a<em style="font-style: normal">%</em></li>
                    <li class="li-end"><span>TIẾT KIỆM</span>
                        @{a = (Model.DonGiaCu - Model.DonGiaMoi) / 1000;}@a<em style="font-style: normal">k</em></li>
                </ul>
                <div class="clr">
                </div>
            </div>
            <div class="clr">
            </div>
            <div class="k2deals-inner-bought">
                @Model.NNguoi/100 người
                <br />
                <span class="small">
                    @{
                        a = 100 - Model.NNguoi;}
                    @a cơ hội</span>
            </div>
            <div class="k2deals-inner-timeleft" align="center" style="height: 80px;width: 164px">
                <p>
                    Thời gian</p>
                <!--p id="note" style="background: none; text-align:center"></p-->
                <span class="defaultCountdown" style="height: 50px; background: none; border: none" id="@Model.Index">
                </span>
            </div>
            <div class="k2deals-inner-rating" style="width: 184px">
                <p>
                    Đánh giá</p>
                <div class="catItemRatingBlock">
                    <div class="itemRatingLog" align="center">
                        <div class='defaultVote' style="margin-top: 0px;">
                        </div>
                        <div>
                            (@Model.NVote bình chọn)</div>
                    </div>
                </div>
            </div>
            <div style="margin-top: 5px !important; background: transparent !important">
            </div>
        </div>
    </div>
    <div style="margin-left: 100px; width: 400px; margin-top: 10px; background-color: #FFF; height: 400px;border-radius: 10px; border: 1px solid #C4C4C4">
        <div class="catItemHeader">
        <div style="height: 20px"></div>
            <h3 class="catItemTitle" style="height: 50px; ">
                <a href="javascript:void()" style="color: #0095DA; font-family: Arial">@Model.TenKM</a>
            </h3>
            <div class="catItemImageBlock" id="@Model.Index" align="center"><!-- style="background-image: url('@Model.HinhAnh'); background-repeat: no-repeat"-->
                <a href="@Url.Action("DetailDeal","Home",new {id= @Model.MaKM})" style="float: left; background-color: #FFF">
                    <img style="float: left; margin-left: -15px;  border-radius: 2px; border: 1px solid #C4C4C4;" height="200px" width="260px" alt="ASD" src="@Model.HinhAnh" />
                </a>
            </div>
        </div>
        <div class="catItemBody">
            <div class="catItemIntroText" style="height: 80px">
                <h2>
                    <strong>Nổi bật: </strong>
                    @{
                        string intro = Model.MoTa;
                        string[] sub = intro.Split(' ');
                        if (sub.Length > 20)
                        {
                            intro = String.Empty;
                            for(int i = 0; i < 20; i++)
                            {
                                intro += sub[i] + " ";
                            }
                            intro += "...";
                        }
                    }
                </h2>
                @intro
            </div>
        </div>
        <div class="catItemCommentsBlock">
            <a href="@Url.Action("DetailDeal","Home",new {id= @Model.MaKM})">Chi tiết</a>
        </div>
        <div class="catItemReadMore" style="margin-left: 0px;">
            <a href="@Url.Content("~/Home/About")">10 bình luận</a>
        </div>
    </div>
</div>
